﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;

namespace SPALM.SharePointSoftwareFactory.SetupHelper
{
  public class Helpers
  {
    internal static string GetInstallationFolderOfVS2010()
    {
      //The registry key:
      string SoftwareKey = @"SOFTWARE\Microsoft\VisualStudio\10.0_Config";
      using (RegistryKey rk = Registry.CurrentUser.OpenSubKey(SoftwareKey))
      {
        try
        {
          //If the key has value, continue, if not, skip it:
          if (!(rk.GetValue("InstallDir") == null))
          {
            string value = rk.GetValue("InstallDir").ToString();
            return value;
          }
        }
        catch (Exception)
        {
        }
      }
      return "";
    }

  }
}
